package test.threadlocal;

public class MyThreadLocalUtil {
    private static final ThreadLocal<String> threadLocal = new ThreadLocal<>();
    //静态方法 保存数据
    public static void save(String value){
        threadLocal.set(value);
    }
    //获取数据
    public static String get(){
        return threadLocal.get();
    }
    //清空数据
    public static void clear(){
        threadLocal.remove();
    }
}
